import axios from 'axios'
import Vue from 'vue'
axios.defaults.baseURL = 'http://api.imooc.hybrid.lgdsunday.club/'
axios.interceptors.request.use(config => {
  if(config.params){
    config.params.token = '2d48df50-b85a-11eb-b146-3f60c901b51b'
  }else{
    config.params = {
      token: '2d48df50-b85a-11eb-b146-3f60c901b51b'
    }
  }
  return config
},error => {
  return Promise.reject(error)
})
axios.interceptors.response.use(response => {
  return response.data
},error => {
  return Promise.reject(error)
})
Vue.prototype.$http = axios